Where y was at the start of this frame’s movement step, before this frame’s motion was applied.
yprev: real (read-only in practice)Where y was at the start of this frame's movement step, before this frame's motion was applied. Nothing stops you from assigning to it, but nothing reads it back either - the engine overwrites it at the start of every frame's motion phase regardless, so treat it as read-only in practice.
Like y itself, it is a place in the room counted from the room's top-left corner, so it can be compared with y directly.
Comparing y against yprev is a cheap way to ask "did this instance actually move this frame" without keeping your own extra bookkeeping variable.
if (y != yprev) {
frame_speed = 1;
} else {
frame_speed = 0;
}Runs after movement (Step End, S2.10's own order) and only keeps the walk animation (frame_speed) advancing while y actually changed this frame - a cheap "is this instance really moving" check with no extra state of its own to track.